<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- Created by htmlize-1.34 in css mode. -->
<html>
  <head>
    <title>git-modeline.el</title>
    <style type="text/css">
    <!--
      body {
        color: #000000;
        background-color: #ffffff;
      }
      .ATTRLIST {
        /* (foreground-color . "firebrick1") */
        color: #ff3030;
      }
      .ATTRLIST-1 {
        /* (foreground-color . "IndianRed4") */
        color: #8b3a3a;
      }
      .ATTRLIST-2 {
        /* (foreground-color . "IndianRed") */
        color: #cd5c5c;
      }
      .builtin {
        /* font-lock-builtin-face */
        color: #da70d6;
      }
      .comment {
        /* font-lock-comment-face */
        color: #b22222;
      }
      .comment-delimiter {
        /* font-lock-comment-delimiter-face */
        color: #b22222;
      }
      .constant {
        /* font-lock-constant-face */
        color: #5f9ea0;
      }
      .function-name {
        /* font-lock-function-name-face */
        color: #0000ff;
      }
      .keyword {
        /* font-lock-keyword-face */
        color: #a020f0;
      }
      .string {
        /* font-lock-string-face */
        color: #bc8f8f;
      }
      .variable-name {
        /* font-lock-variable-name-face */
        color: #b8860b;
      }

      a {
        color: inherit;
        background-color: inherit;
        font: inherit;
        text-decoration: inherit;
      }
      a:hover {
        text-decoration: underline;
      }
    -->
    </style>
  </head>
  <body>
    <pre>
<span class="comment-delimiter">;; </span><span class="comment">
</span><span class="comment-delimiter">;; </span><span class="comment">ref. "test-runner-image.el" posted at
</span><span class="comment-delimiter">;; </span><span class="comment">"http://nschum.de/src/emacs/test-runner/"
</span><span class="comment-delimiter">;;</span><span class="comment">
</span>
(<span class="keyword">provide</span> '<span class="constant">git-modeline</span>)

(<span class="keyword">defvar</span> <span class="variable-name">git--state-mark-modeline</span> t)     <span class="comment-delimiter">; </span><span class="comment">modeline mark display or not
</span>(<span class="keyword">defvar</span> <span class="variable-name">git--state-mark-tooltip</span> nil)    <span class="comment-delimiter">; </span><span class="comment">modeline tooltip display
</span>
(<span class="keyword">defun</span> <span class="function-name">git--state-mark-modeline-dot</span> (color)
  <span class="ATTRLIST-2">(</span>propertize <span class="string">"    "</span>
              'help-echo 'git--state-mark-tooltip
              'display
              `<span class="ATTRLIST-1">(</span>image <span class="builtin">:type</span> xpm
                      <span class="builtin">:data</span> ,<span class="ATTRLIST">(</span>format <span class="string">"/* XPM */
static char * data[] = {
\"18 13 3 1\",
\"  c None\",
\"+ c #000000\",
\". c %s\",
\"                  \",
\"       +++++      \",
\"      +.....+     \",
\"     +.......+    \",
\"    +.........+   \",
\"    +.........+   \",
\"    +.........+   \",
\"    +.........+   \",
\"    +.........+   \",
\"     +.......+    \",
\"      +.....+     \",
\"       +++++      \",
\"                  \"};"</span>
                                     color<span class="ATTRLIST">)</span>
                      <span class="builtin">:ascent</span> center<span class="ATTRLIST-1">)</span><span class="ATTRLIST-2">)</span>)

(<span class="keyword">defun</span> <span class="function-name">git--install-state-mark-modeline</span> (color)
  (push `(git--state-mark-modeline
          ,(git--state-mark-modeline-dot color))
        mode-line-format)
  (force-mode-line-update t))

(<span class="keyword">defun</span> <span class="function-name">git--uninstall-state-mark-modeline</span> ()
  (setq mode-line-format
        (remove-if #'(<span class="keyword">lambda</span> (mode) (eq (car-safe mode)
                                        'git--state-mark-modeline))
                   mode-line-format))
  (force-mode-line-update t))

(<span class="keyword">defun</span> <span class="function-name">git--update-state-mark-tooltip</span> (tooltip)
  (setq git--state-mark-tooltip tooltip))

(<span class="keyword">defun</span> <span class="function-name">git--update-state-mark</span> (color)
  (git--uninstall-state-mark-modeline)
  (git--install-state-mark-modeline color))

<span class="comment-delimiter">;; </span><span class="comment">
</span><span class="comment-delimiter">;; </span><span class="comment">example on state-modeline-mark
</span><span class="comment-delimiter">;; </span><span class="comment">
</span><span class="comment-delimiter">;; </span><span class="comment">(git--install-state-mark-modeline "red")
</span><span class="comment-delimiter">;; </span><span class="comment">(git--uninstall-state-mark-modeline)
</span><span class="comment-delimiter">;; </span><span class="comment">(setq git--state-mark-tooltip "testsetset")</span></pre>
  </body>
</html>
